import fetch from '@/utils/fetch';
//1-录入表信息和用水类别信息

// 1.1表信息和用水类别增加
// 说明：表数据增加
// 接口：api/business/flWatermeterInfo/
// 请求类型：post
export function addWaterMeter(obj) {
    return fetch({
      url: 'api/business/flWatermeterInfo',
      method: 'post',
      data: obj
    });
  }
// 1.2
// 说明：表删除
// 接口：api/business/flWatermeterInfo/
// 请求类型：delete
export function deleteWaterMeter(ArrForid) {
    return fetch({
      url: 'api/business/flWatermeterInfo/' + ArrForid,
      method: 'delete'
    });
  }
// 1.3
// 说明：表修改(点击编辑回显数据)
// 接口：api/business/flWatermeterInfo/
// 请求类型：Get
// 1.4表修改数据
export function modificationWaterMeter(id) {
    return fetch({
      url: 'api/business/flWatermeterInfo',
      method: 'get'
    })
  }
// 1.5
// 说明：表分页查询(条件查询)
// 接口：api/business/flWatermeterInfo/search/{page}/{size}
// 请求类型：Post
export function inquireWaterMeter(page,size) {
    return fetch({
      url: `api/business/flWatermeterInfo/search/${page}/${size}`,
      method: 'post',
      data: obj
    });
  }

  //水表管理接口
  //post分页
  export function postPageSize(page,size,obj) {
    return fetch({
      url: `api/product/flBusinessSore/search/${page}/${size}`,
      method: 'post',
      data: obj
    });
  }
  //查看
  export function getExamine(id) {
    return fetch({
      url: `api/product/flBusinessSore/${id}`,
      method: 'get'
    })
  }
  //修改
  export function putModification(id,obj) {
    return fetch({
      url: `api/product/flBusinessSore/${id}`,
      method: 'put',
      data: obj
    })
  }
  //删除
  export function deleteFun(id) {
    return fetch({
      url: `api/product/flBusinessSore/${id}`,
      method: 'delete',
    })
  }
  //新增
  export function postAdd(id,obj) {
    return fetch({
      url: `api/product/flBusinessSore/${id}`,
      method: 'post',
      data: obj
    })
  }
  //水表管理-导出Excel
  export function getExcel() {
    return fetch({
      url: `api/product/flBusinessSore/exprotExcelModel`,
      method: 'get',
      responseType: 'blob',//解决导出Excel乱码问题
    })
  }

  export function get_kehu() {
    return fetch({
        url: `api/admin/baseAffiliatedcompany/findByParentCode1`,
        method: 'get',
    });
}
  //经销商选择器查订单
  export function postDealerOptions (userCode){
    return fetch({
      url: `api/product/flBusinessSore/userCode?userCode=${userCode}`,
      method: 'post',
    })
  }
 //订单选择器查批次
 export function postOrderOptions (orderid){
  return fetch({
    url: `api/product/flBusinessSore/orderid?orderid=${orderid}`,
    method: 'post',
  })
}
//查询批次方法
export function postOrderlists(childrenCode,orderBatch,batch){
  return fetch({
    url: `api/product/flBusinessSore/UPdealer?childrenCode=${childrenCode}${orderBatch?`&orderBatch=${orderBatch}`:''}${batch?`&batch=${batch}`:''}`,
    method: 'post',
    // params:{
    //   'childrenCode':childrenCode,
    //   'orderBatch':orderBatch,
    //   'batch':batch
    // }
  })
}
